TUTOR FOR MERGEIT We will use the image files eschrB1.pcx and eschrB2.pcx. The initial values file eschrB.ini makes use of the automatic merging process. The file eschr-01.ini trims off the reference blocks from the image margins and is used for the manual merging examples. Start the program from the directory where it is located, with the command=> Mergeit /eschrB.ini OR Mergeit /eschr-01.ini Sequence of program operations: a) Read initial values file, read beginning of lst image. b) Check disk space for required space for output file. c) Analyze top edge of first image for black reference blocks c) Calculate image cutting values, check against first image size available. d) Analyze top edge of second image for black reference blocks e) Calculate image cutting values, check against second image size available. f) Determine RAM space required to rotate image when merging. If space is available, prompt user if they want to rotate and merge. If not enough RAM is available, prompt user if they want to cut the image shorter,use diskspace to store intermediate image file, or not rotate at all before merging. The popular Escher print we will use for the tutorial was scanned in at 200DPI with the print in the landscape orientation. The right half was scanned first, as is the convention for MergeIt. Normally we would merge the scans together without rotation, but for tutorial purposes, we'll work with it both ways. When rotated, the right side of the image will be on top, the top of the print will be on the left side. To do an unrotated trim tutorial, answer "N" until you are prompted to approve of an unrotated merge. Normally you would use automatic trimming to eliminate tedious user adjustments. The first two tutorials are done without this assistance for instructional purposes. The next two tutorials show the usefulness of automatic trimming. The last two tutorials do manual merging of the same images and utilize automatic trimming. You will probably find it helpful to print out the two pcx image files to get oriented to how MergeIt works before doing the trimming. Normally you would have the original hardcopy image to refer to. Simple audio feedback is given during the user trim process while viewing the merged image region: A simple beep indicates the start of a secondary input operation and menu (insert/delete, auto trimming, etc.) which requires more input to finish. A double beep indicates the end of a secondary menu or that the primary menu command is complete by itself (i.e. whole image movement by cursor keys). A triple beep, after a indicates the end of user trimming and either the redisplay of the current viewed region or a continuation of the merge process to the next merge image section. A single, low pitched beep indicates an error, perhaps a trim or movement limit has been reached. Automatic Merging With Rotated Image Without Automatic Trimming (The phrase "Nx" where N is a number means do the operation N times, i.e. 3x= do it 3 times.) Use initial values file "Eschrb.Ini". Answer yes to the question of doing a rotated merge by pressing (i.e. ). Confirm the building of a composite image with the specified height by pressing again. The right most 100 lines of the unrotated image will be shown as the top of the rotated image. The most useful trim at this point might be to add/delete a few lines from the top of the image. Press cursor key 3x, a double beep will follow each entry (indicating a complete user operation). Press "enter" () to see the effect on the image. Wait for a single beep which signals the end of image redisplay process. To undo this change, press cursor key 3x followed by to see the results. To accept this image without further change, and continue the merge process, press . The screen will revert to text mode, describing the merge process: how many lines must be merged in total and how many are in this current scanned image section. When a multiple of 128 lines are finished, this will be displayed until the final (left most) 100 lines of this scanned image section are reached. If you press at this time, when the next 128 lines are finished, the process will pause and a short menu will be displayed. You may quit the program or continue the process at this time. To continue press 'V' or . Finally, the screen will return to a graphic mode and the last 100 lines of the image will be shown. This display process ends with a single beep as before. At this point you have 2 useful operations: trim the bottom edge up or down, or change the view region to a more critical section. Set the image movement step to 4 by pressing "4". Note the change in the "triangle=4" in the top line of the menu. Press the cursor key 1x (2 beeps). Press to see additional 4 image lines at the merge boundary. Set the movement step to 1. You may repeat this input 3x more, after that you will hear a lower pitched, longer beep when you press the key, this signifies the edge of available image to view and merge. Press to see the modifications. You may note that the last lines showed the image masked off by a paper guide I had placed at the edge of the printed image when I scanned. Set the movement step to 5. Press the cursor key 1x to remove most of the extra image lines, then press to see modifications . (We'll leave a few extra lines here for tutorial purposes.) To finally accept the viewed image, press without making any more changes. A small merge edge marker will appear in the center of the screen, denoting the boundary between this and the next scanned section. A few seconds will pass while the next image section is processed. Soon the right most 100 vertical lines (before rotation) of the next image section will be shown as the top 100 lines of the rotated image. The right view shows a little too much the redundant image at the merge. At this point we can ONLY trim the new image, i.e. only the image below the marker. Set the movement step to 1. Press the key 1x to move the image up. Press to see the modification. The left view shows some left-right misalignment. Before doing modifications, lets shift the left view to the left edge (beginning) of the image. Press to bring the alter view menu up. Select the left region by . Move it to the left with . Press to see the new region. Clearly we need to move the whole lower image left. Set the movement step to 4. Press the cursor key 1x. Press to see the effects. While the left black image border is well aligned, we could improve the alignment of the ribbon-like detail 1 1/2" from the left edge with an insertion. Press , then move the marker left with the key 7x. Note that if you press this key once more, you get the error beep since you are at the movement limit. Press the 6x to move the marker 48 pixels to the right (8 pixels at a time). Press '+' to insert one line. Press to return to the general menu. Press to see the change. The curved black line 3 1/2" from the left display edge (on a 14" screen) is misaligned. Press followed by the key 6x. Use the 9x to place the marker in the best position (i.e. least noticeable) and press '+' 3x. End this menu and see the changes with 2x. The right view shows some misalignment. Bring up the insert process with the key. Press 3x. The marker will sit in the middle of the screen, between the two view regions. Press the 8x to move the marker into the right view region. Press '+' 1x. Move the marker a little further right with the 4x. Press '+' 1x. End the insert process with and see the changes with another . Accept this image with a final . The screen will revert to text mode again and messages about the merge process will be displayed The final screen is the left edge of the second image (the bottom edge of the rotated image). The views are of the opposite corners, which is the result of what we selected before. While there are no more images to merge with this edge, you may trim this edge up/down with the / cursor keys. The limit in the down direction depends on how the image was scanned and cut; there may be up to 16 extra lines. In this case, there are less than 6 extra lines. Set the movement step to 1. If you attempt to press the key more than 5x a single low beep will signal the end of the image available to work with. After making any changes and viewing the modifications, a without additional trimming will signal the finishing of the merge process and return you to DOS. Automatic Merging With UnRotated Image Without Automatic Trimming Use initial values file "Eschrb.Ini". Answer no to the question of doing a rotated merge by pressing 'N'. Answer yes to the question of doing an unrotated merge by pressing . There is only one merge region, which is shown on the right half of the screen. The left side of the screen only shows the left edge of the image which is not trimable. With a three or more piece merge process, two merge regions are shown at a time, both trimable. The first 200 lines of the merged image is shown. Note the small region marker which looks somewhat like: "___ __ _" The solid side points to the merge region and indicates the image to the right of the merge is currently selected for trimming. This region is a little high. Set the movement step size to 5 by pressing "5". Press the cursor key 1x, a double beep will follow each entry. Press to see the shifted region and merge (a triple beep indicates the trimming process is over- the merge process will either continue or the current viewed region will be redone). When the modified image is fully displayed, a single beep will sound, prompting you be more input. We overcompensated in our shift according to the top black/white border. Set the movement step to 1. Press the cursor key 1x (but do NOT press yet). Note that the region to the right of the merge is lower than the left by 2 or 3 lines in the center portion. We can delete 2 lines above this region and below the top border. Press the key (1 beep will follow). The image line to be modified will appear as inverted video on the screen. Note that the inverse video effect does NOT run all the way to the actual boundary between scanned image sections. The marked line is initially 1 line below the last displayed image line. We can move this line marker up/down 20 lines at a time with the / keys. You may move the marker 1 line down with the space bar, 1 line up with the key. Since the marker visually moves, no audio feedback is given. Press the key 6x. To delete at the marked line, press the '+' key (1 beep will follow). To delete another line and end this deletion operation, press '+' followed by (2 beeps will found to indicate the end of this operation). Press again to see the modifications (3 beeps will follow). After hearing 1 beep which signals the end of the redisplay process, press to accept the image and continue merging. The next 200 lines will be displayed. The image to the left of the merge is a little below the image on the right. We could add a few lines on the right side, but for practice let us delete 2 lines in the left image. First select that image by pressing the key 1x. The region marker will move to the left side of the merge (followed by a double beep). Then start the delete operation by pressing the key (1 beep will follow) and the marked line will appear at the bottom of the selected image. The line marker can be moved up/down 20 lines at a time with the / keys. Press the key 9x, followed by a '+' to delete 1 line (1 beep). Then press '+' and to delete a second line and end the delete operation (2 beeps). To see the effects of this operation, press (3 beeps-trimming input ended, image redisplayed). When the display is finished, a single beep will sound and the region marker will appear below the right side of the merge. To accept this merge region and continue the process, press (3 beeps). The next 200 lines will be displayed. While this region looks OK as is, since this is a tutorial, lets modify it anyway by moving the image on the right into the merge with the cursor key. Press this key 2x (2 beeps will occur with each entry). Press to see the modified image. Perhaps the return to the beginning image view surprised you? Since you moved the whole right image left, the whole merged image file had to be rebuilt. To accept this merged region, press . After the second display is finished, lets undo the previous operation, move the right image away from the merge. Press the cursor key 2x (2 beeps with each entry). This time, to speed up the rebuild process and avoid viewing the previous image, enter 'B' (build the image again w/o view until the current image) (2 beeps will follow). Then press to do the rebuilding and redisplay the current merge section. While you're waiting for the rebuilding, perhaps you realize it is expedient to do any whole scanned image motion early on in the merge process. If the original image scanning is done with a rigid left guide edge, whole scanned section motion is seldom required after the initial displayed 200 lines. Typically, only line insert/delete trimming is required which may be performed automatically. The screen will revert to text mode and the building of the previous 200 lines will begin. Progress of the merge will be displayed by messages every 128 and 200 lines. Then the screen will return to graphics and the current modified merge region will be displayed. Press to accept this region and the next ones until you get near the bottom edge of the image when the black border of the right image will be lower than the border of the left. To delete 3 lines in the right image, press (1 beep) followed by 9x. The marked line will move near the top of the viewed region. Enter '+' 3x, followed by to perform 3 deletions and end the deletion process (2 beeps). Finally, lets insert a line in the left image. First, press to select the left image. Then press , followed by 4x. Press '+' and to perform 1 insert and end the insert process. Press to see all the modifications. Press to accept region. Most of screen will go black, followed by a few remaining white lines at top. Press to accept these and finish merge. Automatic Merging With UnRotated Image With Automatic Trimming Use initial values file "Eschrb.Ini". Answer no to the question of doing a rotated merge by pressing 'N'. Answer yes to the question of doing an unrotated merge by pressing . There is only one merge region, which is shown on the right half of the screen. The left side of the screen only shows the left edge of the image which is not trimable. With a three or more piece merge process, two merge regions are shown at a time, both trimable. The first 200 lines of the merged image is shown. The top black edge on the left image is too low. Select the left image with the key. Set the image movement step size to 4 by pressing "4". Move this image up 4 lines by pressing the cursor key 1x. End user input with . The merged image will be rebuilt and displayed. The top edge looks good. Since we are using automatic merging by use of the top edge reference blocks, we can assume that image overlap is correct. (If you are merging without the help of reference blocks, you should set the overlap correctly before turning on auto trimming). Now turn auto trimming on and initialize trimming in the currently viewed region by bringing up the appropriate menu and pressing "I". Press to rebuild the merged image and display. The display will show a good merge. As you successively build the image and view the process (by pressing ), the image will remain aligned across the boundary. Automatic Merging With Rotated Image With Automatic Trimming Use initial values file "Eschrb.Ini". Answer yes to the question of doing a rotated merge by pressing . Confirm the building of a composite image with the specified height by pressing again. The right most 100 lines of the unrotated image will be shown as the top of the rotated image. Press to pass to the bottom edge of the 1st rotated image. We want to shift the left half of the displayed regions to the left edge of the rotated image. Enter to bring up the alter view menu. Press to select the left view to shift. Press to shift this view to the left. Press to see the new view (of the left edge). Press to see the top of the next image. We need to move this new image left 4x. Set the movement step size to 4 by pressing "4". Press cursor key 1x followed by to see the result. The left edge looks good but there is clearly some misalignment as the image moves to the right. Turn auto trimming on and initialize the process in the current region by going into the auto trim menu with and then pressing "I". The status line will show that the auto trimming process is ON and that if we redo the currently displayed image, auto trimming will process the boundary region. Press to see the results. Alignment will improve and we can continue the merge process by pressing . When the final bottom edge is shown, press to finish the merging. Manual Merging With Rotated Image With Automatic Trimming Use the initial values file 'Eschr-01.Ini'. Answer yes to the question of doing a rotated merge by pressing . Confirm the building of a composite image with the specified height by pressing again. When viewing the top 1st image region, move the view to the beginning edge of the scanned section (which is now on the left side). We accomplish this by changing the view of the left displayed region to the left edge of the image. Press for the alter view menu. Select the left region with and move the view to the left with . Press to see the new view. Press to accept the image. The screen will revert to text mode as the middle section of this image is built. The final 100 lines of this 1st image will then be displayed. Press to accept the bottom edge of the 1st rotated scanned image section. The top of the 2nd image needs to be moved up. Set the movement step size to 4 lines at a time by pressing "4". Press cursor key 3x. Press to see modification. Some left movement is necessary. Set movement step size to 1 by pressing "1". Press cursor key 2x. Press to see modification. We are close to alignment. Do final alignment by pressing cursor key 1x and cursor key 1x. Press to see modification. While alignment is good, we can turn on automatic trimming to perfect the merging. Press to bring up automatic trimming menu. Press "I" to initiate an auto trimming. Press to see results of trimming. Accept this new merge with . When the bottom of the image is displayed, accept this with a final . Manual Merging With UnRotated Image With Automatic Trimming Use initial values file "Eschr-01.Ini". Answer no to the question of doing a rotated merge by pressing 'N'. Answer yes to the question of doing an unrotated merge by pressing . The left side of the merged region (which is shown on the right side of the screen) is too low. Select this region with . Set the movement size to 4 lines at a time by pressing to "4". Press cursor key 2x. See the adjusted image by pressing . The left region needs a little more movement up. Select this region with the key. Set the movement size to 1 by pressing "1". Move the region up by pressing the key 2x. Press to see the results. The misalignment of the light, slanted ribbon-like detail indicates that there is too much redundant image at the boundary. Set the movement size to 4. We will move both regions closer together. Move the right region to the left by pressing the cursor key. Select the left region by pressing . Move this region to the other one by pressing the cursor key. Press to see the results. Regions need to be a little closer together. Set movement size to 1. Move the right region to the left by pressing cursor key 2x. Press to see results. Alignment is not too bad. Initialize the automatic trim process to improve the merge by pressing followed by "I". Press to see results of auto trimming. Accept the merge with . The subsequent merge regions will stay in alignment thru the auto trim process. Accept each region with . (The last displayed region will be a small white area.) Examining Reference Block Image Analysis This is an optional part of the tutorial, hopefully you won't need to peek into the details of image analysis for determining the black reference blocks. If you are curious, then make a copy of the initial values file "EschrB.Ini" to "EschrBB.Ini" (or whatever name you want). Then edit it with an ascii text editor, changing the 3rd number on the 4th line from 0 to 1000. This will cause each image line that is analyzed for reference block determination to be displayed for 1000 millisecs (1 second). Restart MergeIt with the new initial values file. Once a line's analysis is displayed, pressing will hold this display. Otherwise the next line will be shown after a pause of 1000 millisecs. Restart the merge program with the edited initial values file. As soon as the first line analysis is shown, press to hold this screen. At the top of the screen is the index of the line being shown and the label for the following 5 lines of image information: Left Side. To determine the location of the reference blocks, about 1.5" of the image line is analyzed starting at the left and right edges. These 5 lines display each image dot as a 0 (=black) or 1 (=white). They are arranged with 70 values/line divided into groups of 10 separated by ",". The inverse video dot values indicates the beginning and end of the reference block as determined by the program for that line. (Note that both line indices and dot indices start at 0). Below this line data is a summary of reference block information. "Left Blk Ht/Bot=" refers to the height of the left reference block at this point in the analysis and the line index of the bottom of the reference block. At this point, the height of the block is only 1 and no bottom has been reached (index=0). Similar information is displayed for the right reference block. The next couple of lines display the dot indices on this line for the reference block start dots and the block width in dots. Note that for both the left and right blocks, the start dot is for the block's left side. The last line is a help line for user input: : the analysis will simply continue. "F" : the line by line display will continue but will pause for 1/4 of the present pause time. "S" : the line by line display will continue but will pause for 4x the present pause time. "B" : the line by line display will be terminated, only the summary of analysis for each image will be shown. Continue viewing the line analysis until line index 31. This line determines the bottom of the left reference block. The black line segment is too short. Note that the left block bottom is now shown to be at line index 30 (the previous line). The start and width dot information for the left block on this line is replaced with the phrase "L Blk defined". In the continuing line analysis for the right reference block, no more analysis will be done on the left reference block. Continue viewing the line analysis until line index 36. This line determines the bottom of the right reference block. Line analysis will stop at this point. A summary of the analysis will follow, showing 15 lines of reference block information at a time. The dot indices for edge and width will be listed for the left and right reference blocks. Press to see the next 15 lines of information. The main thing to look for is the stable reference block location and size for each line. The last line or two may be off After all lines are shown, average values for these dot indices will be displayed. Finally, calculated image cut parameters will be listed, again by dot indices, for the X and Y dimensions. For each dimension, the cut indices are listed first, separated by "..". The last value is the size of the original scanned image. If a calculated cut parameter is beyond the image size, it will be flagged with a large value typically >60000. The last line is a help line for user input. Similar to above, you have the choice of faster (F), slower (S), or continue (). Press and as soon as a line's analysis appears, press again. Then press "B" to bypass continued line by line displays. Only the final summary will be shown. To not do the actual image merging, answer the questions about how to merge with "N".